import React, { Suspense } from 'react';
import { useRoutes } from 'react-router-dom';
import './App.css';
import routes from './router/index'

function App() {
  return (
    <div className="app">
      {/* 渲染路由规则 */}
      {/* Suspense和懒加载一起懒加载才会生效 */}
      <Suspense fallback={<div>loading...</div>}>
        {
          // 生成路由表
          useRoutes(routes)
        }
      </Suspense>
    </div>
  );
}

export default App;
